package com.xfcycle.zebrabikegp.database;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * 运动数据 数据库辅助类
 * Created by Wilson on 2017/6/22.
 */

public class SportDataDBHelper extends SQLiteOpenHelper{
    public static final String TBL_SPORT_DATA_HISTORY = "tbl_sport_data_history";

    public static final String DB_NAME = "sport_data.db";

    public static final int VERSION = 1;

    public SportDataDBHelper(Context context){
        super(context,DB_NAME,null,VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        //建表
        db.execSQL("create table "+TBL_SPORT_DATA_HISTORY+"(uuid primary key,bike_id,distance,time TIMESTAMP,calorie,pace,power,date,target INTEGER)");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    }
}
